import { Button, Col, Form, FormInstance, Input, Row, Space } from 'antd';

interface SearchformProps {
  onSearch: (value: any) => void;
  form: FormInstance;
}

const Searchform = (props: SearchformProps) => {
  return (
    <Form form={props.form}>
      <Row gutter={24}>
        <Col span={8}>
          <Form.Item
              name="userName"
              label="账号"
            >
            <Input placeholder='请输入账号' />
          </Form.Item>
        </Col>
        <Col span={8}>
          <Space size="small">
            <Button type="primary" onClick={props.onSearch}>
              查询
            </Button>
            <Button
              onClick={() => {
                props.form.resetFields();
              }}
            >
              重置
            </Button>
          </Space>
        </Col>
      </Row>
    </Form>
  );
};

export default Searchform;
